/*
Package bootstap
@Author   : Uyynot
@Email    : uyynot@qq.com
@Time     : 2024/4/28 17:49
@File     : cache.go
@Project  : gohub
@Desc     :
*/
package bootstap

import (
	"fmt"
	"gohub/pkg/cache"
	"gohub/pkg/config"
)

func SetupCache() {
	//初始换缓存专用的redis client,使用专属缓存DB
	rds := cache.NewRedisStore(
		fmt.Sprintf("%v:%v", config.GetString("redis.host"), config.GetString("redis.port")),
		config.GetString("redis.username"),
		config.GetString("redis.password"),
		config.GetInt("redis.database_cache"),
	)
	cache.InitWithCacheStore(rds)
}
